<?php
class site{
	public function init($params=array()){
		$this->db=$this->yum->library('mysql');
		$this->prefix=$this->yum->vars('app','prefix');
	}
	public function num_rows($params=array()){
		$params['select']='COUNT(*) AS count';
		$count=$this->db->select($this->prefix.'site AS A',$params);
		return empty($count)?0:$count[0]['count'];
	}
	public function Count($params=array()){
		$params['select']='COUNT(*) AS count';
		$count=$this->db->select($this->prefix.'site AS A',$params);
		return empty($count)?0:$count[0]['count'];
	}
    public function GSite($params=array()){
    	return $this->db->select($this->prefix.'site',$params);
    }
	public function ISite($params){
		return $this->db->insert($this->prefix.'site',$params);
	}
	public function USite($params){
		return $this->db->update($this->prefix.'site',$params);
	}
	public function DSite($params){
		return $this->db->delete($this->prefix.'site',$params);
	}
}
?>